package fmi.chesstern.pieces.strategy;

import java.util.HashSet;
import java.util.Set;

import fmi.chesstern.game.BoardField;
import fmi.chesstern.game.GameBoardState;

public class RookStrategy implements ChessPieceStrategy {
	private static final int[][] directions = {
		{-1, 0},
		{0, -1},
		{1, 0},
		{0, 1},
	};

	public Set<BoardField> getValidNewPositions(GameBoardState board, BoardField currentPosition) {
		Set<BoardField> result = new HashSet<BoardField>();
		
		for (int[] direction : directions) {
			result.addAll(StrategyUtilities.getContinuousMoves(board, currentPosition,
					direction[0], direction[1]));
		}
		
		return result;
	}
}
